package com.tsd.system.entity;

import com.tsd.core.jwt.AccessToken;
import com.tsd.core.utils.HlpUtils;
import io.swagger.annotations.ApiModel;

import java.io.Serializable;

/**
 * 注册用户扩展
 *
 * @author Hillpool
 * @date 2022/02/14 15:16:32
 */
@ApiModel(description = "注册用户扩展")
public class SysRegUserExt extends SysRegUser implements Serializable {

    /**
     * 用户类型，1-普通用户，1000-管理员
     */
    public static final Integer USER_TYPE_PUTONG = 1;
    public static final Integer USER_TYPE_ADMIN = 1000;
    public static final String AUTH_SRC_OPEN = "wx_open";
    public static final String AUTH_SRC_MP = "wx_mp";
    public static final String AUTH_SRC_MINIAPP = "wx_miniapp";

    private AccessToken accessToken;
    private String client_sid;

    public AccessToken getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(AccessToken accessToken) {
        this.accessToken = accessToken;
    }

    public String getClient_sid() {
        return client_sid;
    }

    public void setClient_sid(String client_sid) {
        this.client_sid = client_sid;
    }

    public String getRegion() {
        StringBuilder builder = new StringBuilder();
        if (!HlpUtils.isEmpty(this.getCountry())) {
            builder.append(this.getCountry());
        }
        if (!HlpUtils.isEmpty(this.getProvince())) {
            builder.append(this.getProvince());
        }
        if (!HlpUtils.isEmpty(this.getCity())) {
            builder.append(this.getCity());
        }
        return builder.toString();
    }
}